home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1995 May / PC Direct CD-ROM (May 1995).ISO / ipe / manuals / lc30 / lsc3.txt < prev    next >
Encoding:
Text File  |  1994-06-29  |  83.7 KB  |  1,910 lines

  1. LAN Support Center   
  2.   
  3. Copyright 1994, McAfee, Inc.  All rights reserved.  
  4.   
  5. =========================
  6. Part Two: Crystal Reports  
  7. =========================  
  8.   
  9. 9.0 Introduction to Crystal Reports  
  10.   
  11. This chapter introduces Crystal Reports, shows you how to start the   
  12. program, introduces you to some of the things the program can do, and   
  13. familiarizes you with some of the "nuts and bolts" of using the program.  
  14.   
  15. 9.1 About This Part of the Manual  
  16.   
  17. This part of the manual contains all of the information you should need   
  18. for building reports quickly and easily using Crystal Reports. It is   
  19. divided into three chapters:  
  20.   
  21. Chapter                                 Description  
  22. 9.0 Introduction to Crystal Reports     Introduction gives you a brief   
  23.                     overview of Crystal Reports. It   
  24.                     familiarizes you with the Crystal   
  25.                     Reports screens, using the mouse,   
  26.                     error messages, and the help   
  27.                     facility.  
  28.   
  29. 10.0 Using Crystal Reports              This chapter conceptually leads you   
  30.                     through the process of creating a   
  31.                     report with Crystal Reports. It   
  32.                     suggests a methodology for creating   
  33.                     reports starting with nothing more   
  34.                     than a one sentence statement of   
  35.                     purpose for the report.   
  36.   
  37. 11.0 Practical Crystal Reports          Practical Crystal Reports is a   
  38.                     "How to" chapter. It contains a   
  39.                     variety of report creation topics   
  40.                     and additional information on the   
  41.                     practical aspects of using Crystal   
  42.                     Reports to solve typical reporting   
  43.                     problems.   
  44.   
  45.   
  46. For information on topics not found in these chapters, refer to the   
  47. Crystal Reports Help system.  
  48.   
  49. This part of the manual assumes that you understand the basic concepts   
  50. and usage of Microsoft DOS or PC-DOS, and Windows 3.0 or higher. The   
  51. procedures also assume that you will be using a mouse in the creation of   
  52. your reports. While the instructions occasionally indicate keyboard   
  53. methods for using the program, the instructions are generally   
  54. mouse-oriented since most Windows users have a mouse.  
  55.   
  56. 9.1.1 Special Notations Used in this Part  
  57.   
  58. The following notations are used throughout this part of the manual:  
  59.   
  60. o  Delete means the Del key on your numeric keypad.  
  61.   
  62. o  Escape means the Escape or Esc key on your keyboard.  
  63.   
  64. o  Enter means the Enter, Return, or CR key, depending on which of these   
  65. keys appears on your keyboard.  
  66.   
  67. o  Click means to click the left mouse button one time.  
  68.   
  69. o  Double click means to click the left mouse button twice, in quick   
  70. succession.  
  71.   
  72. o  The term Cursor Keys means the Pg Up, Pg Dn, and Arrow Up, Arrow Down,   
  73. Arrow Right, Arrow Left, Home, and End keys on your numeric keypad.  
  74.   
  75. o  Ctrl+Key, Shift+Key, and Alt+Key are examples of the notation for two   
  76. key combinations. They mean to press the first key in the combination   
  77. (Control, Shift, or Alt), and, while keeping it depressed, to press the   
  78. second key in the combination (designated as Key).  
  79.   
  80. o  Text enclosed in double brackets (for example, << information >>) is   
  81. intended to expand or explain the information that it follows.  
  82.   
  83. o  Field names in formulas are italicized.  
  84.   
  85. o  Insert|Formula means to select the Formula option from the Insert menu.  
  86.   
  87. o  Drag, when used in talking about field boxes, means to position the   
  88. cursor on a field box, depress the left mouse button, and keep the button   
  89. depressed while moving the field to a new position.  
  90.   
  91. o  Drag, when used in talking about text, means to depress the left mouse   
  92. button and, while it is depressed, move the I-beam cursor across the text   
  93. of interest to highlight and thus select it.  
  94.   
  95. o  Computer type indicates data that you are to enter using the computer   
  96. keyboard. It is also used to show example formulas.  
  97.   
  98.   
  99. 9.2 Starting Crystal Reports  
  100.   
  101. You can start Crystal Reports in two ways:  
  102.   
  103. o  from the DOS command line  
  104. o  from the Windows environment.  
  105.   
  106. 9.2.1 From DOS  
  107.   
  108. To start Crystal Reports (and Windows at the same time) from the DOS   
  109. command line, type:  
  110.   
  111.     cd  
  112.   
  113. and the name of the directory into which you installed Crystal Reports.   
  114. For example, if you installed Crystal Reports in the default Crystal   
  115. Reports directory, type:  
  116.   
  117.     cd \CRW  
  118.   
  119. and then press Enter.  
  120.   
  121. At the prompt, type:  
  122.   
  123.     win CRW  
  124.   
  125. and press Enter. Windows and Crystal Reports are both started.  
  126.   
  127. 9.2.2 From Windows  
  128.   
  129. Once in Windows, select the group window that holds the Crystal Reports icon.  
  130.   
  131. o  If you're using a mouse, double click on the Crystal Reports icon to   
  132. start the program.  
  133.   
  134. o  If you're using the keyboard, use the arrow keys to select the icon and   
  135. then press Enter.  
  136.   
  137. You can also start Crystal Reports from within Windows by double clicking   
  138. on the file name CRW.EXE in the File Manager.  
  139.   
  140. 9.2.3 The Crystal Reports Registration Dialog Box  
  141.   
  142. The Crystal Reports Registration dialog box appears whenever you start   
  143. Crystal Reports unless you have registered your copy of the program with   
  144. the company, received a serial number, and entered it in the Enter serial   
  145. number... edit box to disable this opening dialog box.  
  146.   
  147. There are two good reasons to register your copy of Crystal Reports:  
  148.   
  149. o  Registration entitles you to technical support should you ever require   
  150. assistance in using the product.  
  151.   
  152. o  Registration assures you that you will be notified whenever the   
  153. product is upgraded to offer new features, benefits, and efficiencies.  
  154.   
  155. The Crystal Reports Registration dialog box options are as follows:  
  156.   
  157. o  Enter serial number... edit box: Use this edit box to enter the   
  158. serial number that Crystal Services sends you when you register the   
  159. program. Be careful to enter the serial number correctly.  
  160.   
  161. o  Proceed to Crystal Reports button:  Use this button to close out   
  162. the dialog box and go directly into the Crystal Reports program. The   
  163. button will be useful until you receive and enter your registration   
  164. serial number. At that time the Crystal Reports Registration dialog box   
  165. will no longer appear when you start the program.  
  166.   
  167. o  Edit Registration Info button:  Use this button to enter/edit product   
  168. registration information. The Edit Registration Info button takes you to   
  169. the Crystal Reports Registration dialog box. Use this dialog box to enter   
  170. your name, company name, and phone and fax numbers. Crystal Reports stores   
  171. this information and displays it and/or prints it out automatically when you   
  172. print out the registration form, call up system information (via the   
  173. Help|System Information command), or send in a technical support request   
  174. (via the Help|Technical Support Request command).  
  175.   
  176. o  Print Registration Form button:  Use this button to print a copy of   
  177. the completed registration form.  
  178.   
  179. 9.2.4 How to Register Your Copy of Crystal Reports  
  180.   
  181. Use the following procedure to register your copy of Crystal Reports.  
  182.   
  183. 1.  Click the Edit Registration Info button.   
  184.   
  185.     The Crystal Reports Registration dialog box appears.  
  186.   
  187. 2.  Enter your name, address, phone, and fax in the edit boxes provided,   
  188.     and click OK when finished  
  189.   
  190.     You are returned to the Crystal Reports Registration dialog box.  
  191.   
  192. 3.  Click the Print Registration Form button.   
  193.   
  194.     Crystal Reports prints out a copy of your completed registration form.  
  195.   
  196. 4.  Fax the form to Crystal Services at the number that appears on the   
  197.     form, or mail it to Crystal Services at the address that appears on   
  198.     the form.  
  199.   
  200. 5.  In a few days, the company will mail or fax you back your serial number.  
  201.   
  202. 6.  Enter the serial number in the Enter serial number... edit box, and   
  203.     click the Proceed to Crystal Reports button when finished.   
  204.   
  205.     This takes you to Crystal Reports and disables the dialog box so it no   
  206.     longer appears when you start the program.   
  207.   
  208.   
  209. 9.3 Quick Start  
  210.   
  211. If you are an experienced Windows user who wants to get right into the   
  212. program, follow these steps to set up a Crystal Reports report for the   
  213. first time after you install the program.  
  214.   
  215. 1.  Start Crystal Reports by double clicking on the Crystal Reports icon   
  216.     in the Program Manager.  
  217.   
  218. 2.  Select New Report from the File menu.  
  219.   
  220. 3.  When the Choose Database File dialog box appears, select the first   
  221.     database you want to activate for your report and press OK when finished.   
  222.   
  223.     The Crystal Reports Report Editor appears with Page Header, Details,   
  224.     and Page Footer sections set up on your report template. The sections   
  225.     are all blank initially.   
  226.   
  227.     Create your report by inserting and formatting items in each of   
  228.     these sections.  
  229.   
  230. 4.  The Insert Database Field dialog box appears on screen with the Report   
  231.     Editor.   
  232.   
  233.     The Insert Database Field dialog box displays a list of all of the   
  234.     fields in the active database. To speed the entry of multiple fields,   
  235.     the box remains on screen until you click on the Done button. You can   
  236.     move the dialog box to a new location if you wish.   
  237.   
  238. 5.  Select the first field you want to appear on the report.   
  239.   
  240.     A rectangular insertion cursor appears.   
  241.   
  242. 6.  Position the cursor at the point in the Details section where you want   
  243.     your field to appear, and click the left mouse button to enter it.   
  244.   
  245.     Crystal Reports marks the field position with a rectangular box. The   
  246.     characters in the box indicate whether the field is text (XXX...),   
  247.     number (555,...), dollar value ($555,...) date (YYYY-M...), or   
  248.     Boolean (T/F). The number of characters in the box indicate the   
  249.     number of characters allowed for the field in the database from which   
  250.     it came.  
  251.   
  252. 7.  Repeat Steps 5 and 6 until you have placed all the fields you want to   
  253.     place.  
  254.   
  255. 8.  To create a title, select Insert|Text Field, type in the information   
  256.     you want to appear, click Accept when finished, and position the field   
  257.     where you want it in the Page Header section.   
  258.   
  259.     You can also insert database fields or special fields in that section   
  260.     from the Insert menu.   
  261.   
  262. 9.  To see how your results will print, select Print To Window from the   
  263.     Print menu. Close the window when you are finished with your review.  
  264.   
  265. 10. If you want to:  
  266.   
  267.     o  change the placement or width of a field  
  268.     o  format the field  
  269.     o  insert a subtotal or grand total for a field  
  270.     o  delete a field  
  271.   
  272.     click the field box for that field. Black handles appear on the right   
  273.     and left sides of the field box to indicate that it has been selected.  
  274.   
  275.     o  To change the placement of the field, drag the field box to   
  276.     its new position using the mouse or the arrow keys. The arrow keys   
  277.     move the field box one grid position each time you press them.  
  278.   
  279.     o  To change the width of the field, drag the right or left handle   
  280.     using your mouse or use a Shift-Arrow combination on your keyboard.  
  281.   
  282.     o  To format or subtotal the field, click the right mouse button   
  283.     while the cursor is inside the field. A pop-up menu appears listing   
  284.     your various options.  
  285.   
  286.         -  To change the font, select Change Font and refine   
  287.         your selection using the Font dialog box when it appears.  
  288.   
  289.         -  To change the format (alignment within field; number,   
  290.         currency, or date display; etc.) select Change Format and   
  291.         refine your selection using the Field Format dialog box   
  292.         when it appears.  
  293.   
  294.         -  To insert a subtotal, select Insert Subtotal and refine   
  295.         your selection using the Insert Subtotal dialog box when   
  296.         it appears. In this dialog box you select the field and the   
  297.         condition that triggers a new subtotal whenever the field's   
  298.         value changes, and you select the sort direction: Ascending   
  299.         (A to Z, 1 to 9) or Descending (Z to A, 9 to 1). The   
  300.         program creates a new section to hold the subtotal.  
  301.   
  302.     NOTE:  The program automatically sorts the data (based on the field   
  303.     that triggers the subtotals) before it subtotals. Manually entering   
  304.     a subtotal sort is not necessary.  
  305.   
  306.         -  To insert a grand total, select Insert Grand Total. The   
  307.         program creates a new section to hold the grand total.  
  308.   
  309.         -  To delete the field, select Delete Field.  
  310.   
  311. 11. To create a formula to make data calculations or comparisons, select   
  312.     Formula Field from the Insert menu.   
  313.   
  314.     Enter a name for your formula in the Insert Formula dialog box, and   
  315.     enter the formula itself in the Formula Editor when it appears. Enter   
  316.     fields, operators, and functions by selecting them from their respective   
  317.     scroll lists.   
  318.   
  319.     You can get complete information on each available Function and   
  320.     Operator via the Help button, and you can check your formula syntax   
  321.     via the Check button. Entering a Crystal Reports formula is similar to   
  322.     entering a formula in a spreadsheet cell. When finished editing,   
  323.     select Accept and place the formula just like you do a database field.  
  324.   
  325. 12. To change the sort order, select Record Sort Order from the print menu.  
  326.   
  327.     Select the field(s) you want Crystal Reports to use for sorting the   
  328.     report data.  
  329.   
  330. 13. To change the sort and group by field, select Group Section from the   
  331.     Edit menu.   
  332.   
  333.     Select the group section of interest from the list that appears in the   
  334.     Edit Group Section (sections) dialog box, and select the new "trigger"   
  335.     field from the Edit Group Section (edit) dialog box when it appears.  
  336.   
  337. 14. If you want to limit your report to specific records (for example,   
  338.     the records of California customers that have YTD sales greater   
  339.     than $10,000), click the first field on which you want your selection   
  340.     to be based (in this case the State field) and choose Select Records   
  341.     from the Print menu or the right mouse button pop-up menu.   
  342.   
  343.     Answer the questions that appear in the Select Records dialog box and   
  344.     click OK when finished. If your selection is based on more than one   
  345.     field, repeat the process with the remaining field(s) until you have   
  346.     completed entering your selection specifications.  
  347.   
  348. 15. When finished, you can print your report by selecting Print To Printer   
  349.     from the Print menu.  
  350.   
  351.   
  352. 9.4 About Crystal Reports  
  353.   
  354. Crystal Reports is a powerful yet easy to use program for creating custom   
  355. reports, lists, and form letters using data from your existing databases.   
  356. The program works by establishing connections with one or more of your   
  357. databases.   
  358.   
  359. Using these connections as conduits, Crystal Reports draws in the values   
  360. from database fields you select and uses them in the report, either in   
  361. their original form or as part of a formula that generates more   
  362. sophisticated values.  
  363.   
  364. Crystal Reports was designed to work with all kinds of data: numbers,   
  365. currency, text, dates, and Boolean (Yes/No) fields. It has a wide range of   
  366. built-in tools that you can use to manipulate that data to fit your needs.   
  367. Using these tools, you can:  
  368.   
  369. o  make calculations and comparisons of data values,  
  370. o  calculate subtotals, and grand totals of field values,  
  371. o  calculate group averages, count the records in a group, and test   
  372. for minimum and maximum values,  
  373. o  test for the presence of specific values,  
  374. o  present data only if certain conditions are met,  
  375. o  evaluate logical relationships between values,  
  376. o  convert data from one type to another,  
  377. o  merge text with other text,  
  378. o  merge text with data field data, and  
  379. o  perform numerous other useful, data-related activities.  
  380.   
  381. The data can be placed wherever you want it on the report, highlighted   
  382. with special fonts and font sizes. With Crystal Reports, your reports can   
  383. be as simple or as complex as your needs demand.  
  384.   
  385. 9.4.1 How Crystal Reports Prepares Reports  
  386.   
  387. Crystal Reports prepares reports by reading data in the database files   
  388. you have selected and making that data available for use in your report.  
  389.   
  390. o  If you wish to use data in a single data file, you simply choose that   
  391. file when you create the report.  
  392.   
  393. o  If you wish to use data in multiple data files, you need to select the   
  394. files and also to indicate the field or fields in each file that Crystal   
  395. Reports is to use to match data.   
  396.   
  397. NOTE:  Crystal Reports does not write data to your original data files.   
  398. Your original files remain unchanged using Crystal Reports, no matter how   
  399. much you might manipulate the data you select.  
  400.   
  401. 9.4.2 Databases that Work with Crystal Reports  
  402.   
  403. Crystal Reports can build reports using the standard data files generated   
  404. by dBASE for Windows and Paradox for Windows as well as with DOS versions   
  405. of dBASE and Paradox.    
  406.   
  407.   
  408. 9.5 The Crystal Reports Window  
  409.   
  410. The Crystal Reports window is simple and easy to understand:  
  411. o  the Title Bar appears at the top of the window,   
  412. o  the Menu Bar appears just below the Title Bar, and  
  413. o  the Button Bar appears just below the Menu Bar.  
  414.   
  415. 9.5.1 Title Bar  
  416.   
  417. The Title Bar displays the name of the program running in the window,   
  418. Crystal Reports. You can use the title bar to activate the window   
  419. (if the window is buried in a cascade of windows) or to move the window   
  420. (by depressing the left mouse button with the pointer on the title bar   
  421. and then, while the button is still depressed, dragging the window to a new   
  422. location), or to maximize the window (by double clicking on the title bar).  
  423.   
  424. 9.5.2 The Menu Bar  
  425.   
  426. The Menu Bar is Crystal Reports' command center. Each option on the menu   
  427. bar calls up a drop down menu of commands that you can use to create,   
  428. modify, print, and save your reports.  
  429.   
  430. Each menu is listed in the table below:  
  431.   
  432. File    The File menu includes commands you can use to open, close, and   
  433.     save files, to save files under a different file name, print the   
  434.     file to a printer, and create new report files. It also includes   
  435.     a command you can use to exit Crystal Reports. Additionally it   
  436.     contains a command that allows you to configure Crystal Reports   
  437.     to your specifications.  
  438.   
  439. Edit    The Edit menu allows you to modify aspects of your report. The   
  440.     menu includes commands you can use to edit formulas, to edit and   
  441.     delete group sections, and to change summary operations. It also   
  442.     contains commands for cutting, copying, and pasting text, clearing   
  443.     (deleting) report elements, toggling the display of field names on   
  444.     and off, and changing your report title.  
  445.   
  446. Insert  The Insert menu is the central menu you use for creating reports.   
  447.     The menu includes commands you can use to insert database fields,   
  448.     text fields, and formula fields; subtotals, grand totals,   
  449.     summaries (counts, averages, etc.), and group sections; print date,   
  450.     page number, record number and group number fields; and graphics,   
  451.     lines, and boxes.  
  452.   
  453. Format  The Format menu includes commands for changing the look of the   
  454.     elements in your report. It includes commands for changing fonts,   
  455.     and formatting fields, report sections, graphics, lines, and boxes.   
  456.     The menu also provides commands for adding field borders as well as   
  457.     background color and drop shadows for your fields.  
  458.   
  459. Data-   The Database menu is used to select and delete databases for use   
  460. base    with your reports, to change the alias you use to identify the   
  461.     database, and to link and unlink databases. It also has a command,   
  462.     File Location, for directing Crystal Reports to look for database   
  463.     files in new locations. Two verify commands can be used to adapt   
  464.     your reports to minor changes in database structure.   
  465.   
  466. Print   The Print menu includes commands that let you print your report to a   
  467.     print window, to a disk file, or to a printer, print the report   
  468.     definition (a report describing your report), select the records   
  469.     or groups to be included in your report, select the order in which   
  470.     report data is to be sorted (by record or by group), and select a   
  471.     printer if you want the report to print on something other than the   
  472.     default printer.  
  473.   
  474. Window  The Window menu includes commands that let you rearrange icons and   
  475.     windows. It also lists the report windows that are open and includes   
  476.     a command that lets you close all report windows at once, if desired.  
  477.   
  478. Help    The Help menu includes a command that takes you to Crystal Reports'   
  479.     main help index, a command that will give you information about the   
  480.     Crystal Reports version you are using, and other help-related topics.  
  481.   
  482.  9.5.3 The Button Bar  
  483.   
  484. Crystal Reports groups several commonly-used commands on a Button Bar that   
  485. remains on screen at all times (unless you choose to turn it off).  
  486.   
  487. Each command is represented by an individual button, and each button   
  488. displays a graphic that visually describes the command. You activate   
  489. Button Bar commands by clicking the appropriate button one time with the   
  490. left mouse button. The Button Bar eliminates some of the steps needed to   
  491. activate the included commands, and it can thus greatly speed your   
  492. work in creating reports.   
  493.   
  494. 9.5.4 The Status Bar  
  495.   
  496. The status bar at the bottom of the report window displays valuable   
  497. information to help you use Crystal Reports more efficiently:  
  498.   
  499. o  Button bar functions:  When the cursor is over a Button Bar button,   
  500. the Status Bar displays a short description of the button's function.  
  501.   
  502. o  Menu command descriptions:  When you highlight a menu command, the   
  503. Status Bar displays a short description of the command. To highlight a   
  504. menu command, click the menu name and move to the command using the Down   
  505. Arrow key.  
  506.   
  507. o  Current selections:  When you select or place a graphic, field, text   
  508. field, graphic line or box, special field, or formula, the status bar   
  509. displays the name of the item selected. It displays:  
  510.   
  511.     -  the file name for a graphic,   
  512.     -  the alias and field name for a field,   
  513.     -  the text in a text field,   
  514.     -  the words Line for a line and Box for a box,  
  515.     -  the field type for special fields (PrintDate, RecordNumber, etc.)  
  516.     -  the formula name for a formula.  
  517.       
  518. o  Graphic Coordinates:  When you select or create a bit-mapped graphic,   
  519. a graphic box, or a graphic line, the program displays the coordinates   
  520. for the left, right, top, and bottom sides of the graphic element.  
  521.   
  522.   
  523. 9.6 Right Mouse-Button Capabilities  
  524.   
  525. When you are working in the Report Editor, you can speed up your work   
  526. considerably using Crystal Reports' right mouse button capabilities. When   
  527. the cursor is positioned on a report element (a field, a group field, a   
  528. formula, etc.) and you click the right mouse button, Crystal Reports   
  529. displays a pop-up menu right next to the element. Unlike Crystal Reports'   
  530. standard menus that group commands by function (editing, inserting, etc.),   
  531. these pop-up menus are element-specific: that is, they contain only those   
  532. commands from Crystal Reports' primary menus that are available for   
  533. use with the selected element.   
  534.   
  535. The pop-up menus are valuable because:  
  536.   
  537. o  they display the name and source (alias) of the element at the top of   
  538. the menu so you can identify the elements on your report with a single   
  539. mouse click,  
  540.   
  541. o  they appear right next to the selected element making them quicker and   
  542. easier to access than Crystal Reports' main menus,  
  543.   
  544. o  they contain only the commands you need; you don't need to search for   
  545. commands on a more comprehensive menu,  
  546.   
  547. o  they make it easier to learn Crystal Reports because:   
  548.   
  549.     - they eliminate the need to remember where to find a command, and  
  550.     - they make it easier to pick the right command since you're dealing   
  551.     with only a compact list of, and  
  552.   
  553. o  they spotlight the things you can do with an element making it an   
  554. easier system to use when you are under pressure or distracted.  
  555.   
  556. Use the following procedure to use the right mouse button menus:  
  557.   
  558. 1.  Position the cursor on the element of interest.   
  559.   
  560. 2.  Click the right mouse button.   
  561.   
  562.     The pop-up menu appears.  
  563.   
  564. 3.  Select the command of interest from the pop-up menu.   
  565.   
  566.     These options work exactly like the corresponding options that appear   
  567.     on Crystal Reports' primary menus.  
  568.   
  569. For information on using any of these menu options, see the corresponding   
  570. option in Crystal Reports Help.  
  571.   
  572. NOTE:  If you have swapped left/right mouse buttons via the Control Panel,   
  573. the left mouse button will activate the pop-up menus.  
  574.   
  575.   
  576. 9.7 Crystal Reports Report Windows  
  577.   
  578. When a Crystal Reports report appears, it appears in a report window. A   
  579. report window has a title bar, minimize and maximize buttons, and a   
  580. control menu box like the Crystal Reports window.  
  581.   
  582. Unlike the Crystal Reports window, the report window does not have its own   
  583. menu. Instead, the commands from the Crystal Reports menu remain visible and   
  584. are active for the document window.  
  585.   
  586. Also unlike the Crystal Reports window, the document window has scroll   
  587. bars at the bottom and along the right hand edge. Usinh these scroll bars    
  588. you can reveal parts of the document that aren't immediately showing in the   
  589. window.  
  590.   
  591.   
  592. 9.8 Getting Help with Crystal Reports  
  593.   
  594. Crystal Reports offers a comprehensive help system to support you during   
  595. every step of the report development process.  
  596.   
  597. 9.8.1 Context Sensitive Help  
  598.   
  599. Context sensitive help gives you immediate help with a screen element of   
  600. interest (menu command, dialog box, etc.). The program takes you directly   
  601. to the help information you seek without the need to traverse the indexing   
  602. system.  
  603.   
  604. NOTE:  To get help on a specific menu command, click the menu name and   
  605. then use the Down Arrow key to highlight the command of interest. Once the   
  606. command is highlighted, press F1.  
  607.   
  608. 9.8.2 Indexed Help  
  609.   
  610. Indexed help takes you to the help indexing system, a hierarchy of indexes   
  611. which is designed to help you target your topic of interest. Using the   
  612. indexing system, you can select a broad topic of interest from the first   
  613. index and then narrow your selection using the next index that appears,   
  614. then the next. etc.   
  615.   
  616.   
  617. 10.0 Using Crystal Reports  
  618.   
  619. This chapter provides a structured approach to preparing reports with Crystal   
  620. Reports.  
  621.   
  622. 10.1 Using Crystal Reports  
  623.   
  624. The approach of this chapter in preparing reports with Crystal Reports   
  625. includes the following elements:  
  626.   
  627. o  deciding on the content of your report,  
  628. o  developing a prototype on paper,  
  629. o  setting up the prototype using Crystal Reports,  
  630. o  manipulating the data with formulas and functions,  
  631. o  grouping, summarizing, and sorting your data,  
  632. o  editing and formatting the data,  
  633. o  specifying the records/groups to be included in the report, and  
  634. o  printing the finished report.  
  635.   
  636. This is not a hands-on chapter, but an important introduction that can   
  637. make your report creation work more efficient and more satisfying. The   
  638. chapter has been designed to provide you with a conceptual understanding   
  639. of Crystal Reports as well as a brief introduction to Crystal Reports'   
  640. powerful features.   
  641.   
  642.   
  643. 10.2 Deciding on the Content of Your Report  
  644.   
  645. Before you do anything else, you should outline the information you want   
  646. your report to provide. Use the following list of questions as a guide in   
  647. making that outline:  
  648.   
  649. o  What is the overall purpose of the report?  
  650. o  Who is going to read the report?  
  651. o  What is the report title going to be?  
  652. o  What information do you need besides the title to identify the report?  
  653.     - Where is that information to come from?  
  654.     - If the information exists in a database, what types of fields   
  655.     is the data stored in: number, text, etc.?  
  656. o  What identifying information do you want to appear at the bottom of   
  657. each page?  
  658.     - Where is that information to come from?  
  659.     - If the information exists in a database, what types of fields   
  660.     is the data stored in: number, text, etc.?  
  661. o  What specific data do you want to appear in the body of the report?  
  662.     - Where is that data to come from?  
  663.     - Does that data exist in data fields or does it need to be   
  664.     calculated from data field values?  
  665.     - What kind of fields is the data stored in: number, text, etc.?  
  666.     - Do you want to show totals?  
  667.     - What kind?  
  668.     - What do you want to total?  
  669. o  What information, if any, do you want flagged on the report?  
  670.     - How do you want it flagged?  
  671. o  What information do you want highlighted in some way so that it really   
  672. stands out?  
  673. o  Do you want the report to be based on all records in the database or   
  674. only on specified records?  
  675.   
  676. 10.2.1 Purpose  
  677.   
  678. What is the overall purpose of the report?  
  679.   
  680. Reports are management tools. Their purpose is to help individuals quickly   
  681. grasp the essential elements and relationships found in raw data so they   
  682. can make effective decisions. For a report to be effective, it has to   
  683. present the right data in a logical way. If it presents the wrong data or   
  684. if it presents the right data in a haphazard manner, the report may slow   
  685. the decision making process or even encourage incorrect decisions.  
  686.   
  687. A good starting place in the development of a report is to write out the   
  688. purpose of the report in a sentence or two. The purpose statement helps you   
  689. focus on your primary needs, and it gives your report both a starting point   
  690. and a goal.   
  691.   
  692. Here are some examples of purpose statements:  
  693.   
  694. o  The purpose of this report is to show monthly and year-to-date sales   
  695. by sales rep, compare this year's numbers to last year, and flag reps who   
  696. are seriously deficient.  
  697.   
  698. o  The purpose of this report is to show sales activity for each item in   
  699. inventory, and to suggest reorder quantities based on that activity.  
  700.   
  701. o  The purpose of this report is to calculate bowling averages and   
  702. handicaps for each member of the bowling league.  
  703.   
  704. Clarifying the purpose of the report before you start is a critical step in   
  705. the overall process. A report without a clear purpose is like a meeting   
  706. without a clear agenda; it rambles and accomplishes little.  
  707.   
  708. 10.2.2 Readers  
  709.   
  710. Who is going to read the report?  
  711.   
  712. A single report is often used by many individuals. A detailed, company-wide   
  713. sales report, for example, may be used by sales reps, the regional sales   
  714. manager, the national sales manager, and the Chief Operating Officer (COO).   
  715.   
  716. Each of these individuals will be interested in different aspects of the   
  717. report.  
  718.   
  719. o  A sales rep will use the report to evaluate his/her individual sales   
  720. performance and to compare that performance to that of other reps in the   
  721. region.  
  722.   
  723. o  The regional sales manager will use the report to evaluate the reps in   
  724. his/her region and to compare the region's performance to that of other   
  725. regions.   
  726.   
  727. o  The national sales manager will use the report to evaluate the   
  728. performance of his/her regional managers and to compare overall sales to the   
  729. current sales forecasts.  
  730.   
  731. o  The COO will use the report to evaluate the performance of the Vice   
  732. President of Marketing and the sales department as a whole, and to project   
  733. such things as manufacturing needs, warehouse locations, etc.  
  734.   
  735. Since each of the users of the report has different interests, it is   
  736. important to plan the report so it includes the information each of the   
  737. users is looking for.  
  738.   
  739. 10.2.3 Title  
  740.   
  741. What is the report title going to be?  
  742.   
  743. Write out a working title for your report. You may decide to change it   
  744. later, but at least you will have a title to use when creating your   
  745. prototype report.  
  746.   
  747. 10.2.4 Other Header Information   
  748.   
  749. What information do you need besides the title to identify the report?  
  750.   
  751. Are you going to include identifying information in addition to your   
  752. report title? You may wish to include the current date, information on   
  753. who prepared the report, a block of text to describe the purpose of the   
  754. report, the range of data covered, etc. If you are going to include such   
  755. information, write it down so you can use it in preparing your prototype.  
  756.   
  757. 10.2.5 Header Information Sources  
  758.   
  759. Where is that information to come from?  
  760.   
  761. The information can come from a variety of sources, depending on the kind   
  762. of information you plan to use. For example, the current date can be   
  763. inserted using the Crystal Reports Insert|Print Date Field command.   
  764. Information on who prepared the report might be drawn from individual data   
  765. fields in the database(s) used. (If it is to be drawn from a database, what   
  766. database? Or, what combination of databases?) A block of text can be   
  767. created and entered on the face of the report itself. As you begin to think   
  768. of where the information is to come from, you begin formally structuring   
  769. the report.  
  770.   
  771. 10.2.6 Data Types in the Header  
  772.   
  773. If the information exists in a database, what types of fields contain the   
  774. data: number, text, etc.?  
  775.   
  776. Crystal Reports uses different rules for working with different types of   
  777. data. You will find it helpful later if you note the data type of each   
  778. piece of data you plan to draw from a database.  
  779.   
  780. 10.2.7 Footer Information  
  781.   
  782. What identifying information do you want to appear at the bottom of each   
  783. page (page number, report name, author's name, "Confidential," etc.)?  
  784.   
  785. 10.2.8 Footer Data Sources  
  786.   
  787. Where is that information to come from?  
  788.   
  789. 10.2.9 Data Types in the Footer  
  790.   
  791. If the information exists in a database, what types of fields is the data   
  792. stored in: number, text, etc.?  
  793.   
  794. 10.2.10 Report Body Data  
  795.   
  796. What specific data do you want to appear in the body of the report?  
  797.   
  798. When you think of a report, it is probably the body of the report that you   
  799. think of. The body should contain all the data that you need to fulfill the   
  800. statement of purpose you wrote for the report. It should also contain all of   
  801. the data needed by the various users that you have identified. You   
  802. might find it helpful to list first the basic data that is required to   
  803. fulfill the purpose statement, and then list the more specific kinds of data   
  804. needed by the various users.  
  805.   
  806. 10.2.11 Body Data Sources  
  807.   
  808. Where is that data to come from?  
  809.   
  810. This step requires you to look at the available databases. Crystal Reports   
  811. allows you to combine data from different databases to create your reports,   
  812. so you have a great deal of flexibility in your work.  
  813.   
  814. o  Much of the data in a typical report will be taken directly from data   
  815. fields. Which data fields will you be using and where are they located?  
  816.   
  817. o  Other data will be calculated based on data fields. Which data fields   
  818. will be used in the calculations?  
  819.   
  820. o  Still other data will be input directly into the report (headings, text   
  821. blocks, etc.). Which data will you enter directly on the report, without   
  822. drawing it from data fields?  
  823.   
  824. 10.2.12 Existing or Calculated?  
  825.   
  826. Does that data exist in data fields or does it need to be calculated from   
  827. data field values?  
  828.   
  829. Some report information can be drawn directly from data fields (sales   
  830. information, for example); other information will have to be calculated   
  831. based on data field values (sales commission, for example, based on the   
  832. relationship of sales to quota). In your planning, it can be helpful to   
  833. segregate or flag data that needs to be calculated from that which can   
  834. be used directly.  
  835.   
  836. 10.2.13 Data Types in the Body  
  837.   
  838. What kinds of fields contain the data: number, text, etc.?  
  839.   
  840. While it is important to understand data types for all data you will be   
  841. using, it is of critical importance that you know the data type for data   
  842. fields that will be used in calculations. Functions and operators work with   
  843. specific kinds of data, so it's important to know the data type to   
  844. know which functions and operators you can use in your calculations.  
  845.   
  846. 10.2.14 Groups  
  847.   
  848. Do you want your data organized into groups? How do you want it grouped? By   
  849. customer? By date?   
  850.   
  851. 10.2.15 Group Values  
  852.   
  853. Do you want to show a subtotal at the end of each group? A count? An   
  854. average? Crystal Reports allows you to specify several kinds of group values.  
  855.   
  856. 10.2.16 Group Value Positions  
  857.   
  858. Where do you want the group values to appear. With the group data? With the   
  859. group data but on a page separate from other groups? Only at the bottom of   
  860. the page?  Crystal Reports gives you all of these options.  
  861.   
  862. 10.2.17 Grand Totals, Grand Total Averages, etc.  
  863.   
  864. Do you want to total (or average, count, or determine the maximum or   
  865. minimum value included in) all the values in any column on your report?  
  866.   
  867. Crystal Reports allows you to do this and place the grand total (or the   
  868. grand total average, grand total count, etc.) at the bottom of the selected   
  869. column.  
  870.   
  871. 10.2.18 Flags  
  872.   
  873. What information, if any, do you want flagged on the report?  
  874.   
  875. You may want to call attention to some data by flagging it on your report.   
  876. For example, non-moving inventory items are often flagged on inventory   
  877. reports so they can be given special attention. If you want any information   
  878. flagged, identify the information and the parameters for flagging.   
  879.   
  880. Using the inventory report example, you might want to flag each item that   
  881. has shown no activity during the last month, during the last three months,   
  882. or during some defined period.  
  883.   
  884. 10.2.19 Flag Options  
  885.   
  886. How do you want it flagged?  
  887.   
  888. You may want to flag items with an asterisk or some other symbol, or you   
  889. may want a word to appear as a flag. In any case, you should write out   
  890. flagging instructions so they are handy.  
  891.   
  892. 10.2.20 Highlights  
  893.   
  894. What information do you want highlighted in some way so that it really   
  895. stands out?  
  896.   
  897. Crystal Reports gives you the opportunity to underline report elements, or   
  898. to change the fonts or font size used for specific report items. All of   
  899. these formatting tools can be used to highlight key data on a report. If   
  900. you have data that you want highlighted, you should write down highlighting   
  901. instructions so they are handy too.   
  902.   
  903. 10.2.21 Record or Group Selection  
  904.   
  905. Do you want the report to be based on all records or groups in the database   
  906. or only on specified records or groups?  
  907.   
  908. Crystal Reports gives you the opportunity to base a report on all records in   
  909. a given database, or on a limited set of records from the database. Using   
  910. Crystal Reports you can select records based on simple date ranges or   
  911. comparisons, or you can create complex formulas to identify the records   
  912. to be included. Take a few minutes to determine the records needed for your   
  913. report and list the criteria to be used for selecting those records.  
  914.   
  915. 10.2.22 Sorting  
  916.   
  917. Do you want your data sorted based on record or group values?  
  918. Crystal Reports gives you both alternatives.  
  919.   
  920.   
  921. 10.3 Developing a Prototype on Paper  
  922.   
  923. Graphic designers generally begin their work on a magazine cover,   
  924. brochure, or display advertisement with a rough pencil sketch. They often   
  925. use boxes, circles, or other symbols to represent the graphic elements they   
  926. intend to include in the final product, and they often use lines or   
  927. scribbles to represent text. Doing the rough design on paper, in pencil,   
  928. helps them create a "look" for each page. It helps them find a balanced   
  929. way of positioning the various elements before they begin working with   
  930. sophisticated graphics tools. We think you will find a similar exercise   
  931. helpful in designing your Crystal Reports reports.  
  932.   
  933. While a paper prototype is useful regardless of your expertise with Crystal   
  934. Reports, it is particularly valuable when you are first learning to use the   
  935. Crystal Reports program. With the paper prototype at hand, you can put your   
  936. full effort into learning and using the Crystal Reports commands instead of   
  937. trying to design and learn at the same time.  
  938.   
  939. Use the following procedure to design a paper prototype with Crystal Reports:  
  940.   
  941. o  Get paper of the size you'll be using for your finished report.  
  942. o  Position your title and other descriptive header information, using   
  943. boxes or lines to represent report elements.  
  944. o  Position your footer information.  
  945. o  Review the page for balance.  
  946. o  Look at the information you intend to include in the body of your report.  
  947.     - Count the number of fields you will be using and estimate the   
  948.     appropriate spacing between fields.  
  949.     - Use rectangles to pencil in the fields using your estimated spacing.  
  950.     - Change the spacing if necessary.  
  951.     - Decide on a logical sequence for presenting the report data.  
  952.     - Label the fields to indicate that sequence.  
  953. o  Use small boxes to indicate group values and totals.  
  954. o  Place some random flags where you want the flags to appear.  
  955. o  Darken any elements you want highlighted so they stand out from the   
  956. rest of your prototype.  
  957. o  Review your finished product for look and balance, and make changes as   
  958. needed.  
  959.   
  960.   
  961. 10.4  Setting Up the Prototype Using Crystal Reports  
  962.   
  963. Once you have completed your paper prototype, it is a straightforward   
  964. process to recreate that prototype in the computer, using Crystal Reports.   
  965. Before you do, it is important to understand how Crystal Reports' report   
  966. editing process works.  
  967.   
  968. NOTE:  This section assumes that you are new to Crystal Reports and that   
  969. you plan to build a simple report using data from a single database. No   
  970. advanced topics are covered in this section.  
  971.   
  972. When you want to begin a new report, Crystal Reports displays the Choose   
  973. Database File dialog box.  You use this dialog box to select the database   
  974. file(s) that contain the data you want to use in your report. You will   
  975. first select the directory and, once in the directory, you can select the   
  976. database file you identified earlier in Deciding on the Content of Your   
  977. Report.  
  978.   
  979.   
  980. 10.5  The Report Editor  
  981.   
  982. Once you select your database, Crystal Reports displays the Report Editor   
  983. screen. You use this screen to insert and format data and to watch your   
  984. report take shape.  
  985.   
  986. When you open a new report, Crystal Reports automatically creates three   
  987. sections in the Report Editor:  
  988.   
  989. o  A Page header section - this section is generally used for the report   
  990. title, field headings, and other information that you want to appear at the   
  991. top of each page.  
  992. o  A Details section - this section is the body of the report. The bulk of   
  993. your report data will generally appear in this section.  
  994. o  A Page footer section - this section usually contains the page number   
  995. and any other information that you want to appear on the bottom of each page.  
  996.   
  997. The name of each section appears in the gray area to the left of the Report   
  998. Editor edit box.  
  999.   
  1000. o  You build your report by inserting data fields, formulas, and other   
  1001. report elements (record counts, record numbers, etc.) in the Details   
  1002. section of the editor. You use the Insert menu, in most cases, to select   
  1003. or create the elements you want to insert on the report. The Report Editor   
  1004. uses rectangular element markers to indicate the size, position, and data   
  1005. type of the report elements you have inserted.  
  1006.   
  1007. o  You add subtotals (and other group values) by selecting a field to   
  1008. subtotal and then telling Crystal Reports the conditions that are to   
  1009. generate a new subtotal or group value (change of customer number, change   
  1010. of sales rep, etc.). Crystal Reports creates group value sections as   
  1011. needed and places the group value in the section. Again, Crystal Reports   
  1012. uses rectangular field boxes to represent the group values.  
  1013.   
  1014. o  You insert grand totals in the Grand Total section. This section appears   
  1015. when you select the field to total and then select Insert|Grand Total.   
  1016. Crystal Reports uses a rectangular field box, this time to identify the   
  1017. field in the Grand Total section of the Report Editor.  
  1018.   
  1019. o  You can add freeform text anywhere on the report by positioning the   
  1020. text cursor in the section in which you want the text to appear, typing in   
  1021. the text, and then using the Tab key to move it into position. You can also   
  1022. type freeform text in a text field; this allows you to avail yourself of   
  1023. additional formatting options (alignment, hide options, etc.).  
  1024.   
  1025. 10.5.1 Auto-Scrolling Capabilities  
  1026.   
  1027. The Report Editor has auto-scrolling capabilities. That is, whenever the   
  1028. cursor hits one of the edges of the Report Editor when you are placing,   
  1029. resizing, or moving a field or drawing a graphic line or box, the Editor   
  1030. automatically scrolls to reveal more workspace (if more is available).  
  1031.   
  1032. 10.5.2 Resizing Sections  
  1033.   
  1034. The Report Editor first appears with default section sizes. You can expand   
  1035. or reduce report sections by dragging the lines that separate the sections.   
  1036. When you position the I-beam cursor over one of those lines, the cursor   
  1037. changes to a double-arrow resizing cursor. Once that cursor appears,   
  1038. you can resize as needed. Alternately, to expand a report section, you can   
  1039. click the section of interest and press Enter as many times as needed. Once   
  1040. you've expanded a section, you can reduce it by deleting unneeded lines with   
  1041. the Backspace key.  
  1042.   
  1043. 10.5.3  A Word about Databases, Records and Fields  
  1044.   
  1045. Before we go any further, a discussion of databases, records, and fields   
  1046. is in order. A record is the basic building block of a database. Each record   
  1047. contains data about a single entity (a customer, an order, etc.), and each   
  1048. database contains at least one record. The data in each record is stored in   
  1049. fields (holding spaces). Each field holds one piece of data known as a value.   
  1050. The database from which you will create a report is a collection of related   
  1051. records. A customer database, for example, is a collection of records that   
  1052. each contain data on a single customer.  
  1053.   
  1054. 10.5.4 Records and Fields in Row/Column Reports  
  1055.   
  1056. Think of the data in a database as being stored in horizontal rows and   
  1057. vertical columns.  
  1058.   
  1059. CustNumber              Fname           Lname  
  1060. 01034456                Bill            Brown  
  1061. 01034457                Jane            Doe  
  1062. 01034458                Bob             Jackson  
  1063. 01034459                Mary            Jones  
  1064.   
  1065. The table above shows field values for four records from such a database   
  1066. (in this case a customer database).   
  1067.   
  1068. o  Each row represents one record. All of the data in that row is about a   
  1069. single customer, but the data is broken into three distinct pieces: customer   
  1070. number, first name, and last name. Each of those pieces represents a   
  1071. value found in a field on that record, the CustNumber, Fname, and Lname   
  1072. fields respectively (as indicated by the column headings).  
  1073.   
  1074. o  Each column represents one field. All the data in a given column   
  1075. represents the values that appear in that field on each of the records in   
  1076. the database.  
  1077.   
  1078. The structure of a row/column report corresponds to the structure of a   
  1079. database with rows representing individual records and columns   
  1080. representing individual fields.   
  1081.   
  1082. 10.5.5  Records and Fields in Data Block Reports  
  1083.   
  1084. Some reports don't follow the row/column format, however. Instead, some group   
  1085. related data in data blocks. A mailing list, for example, typically uses   
  1086. several rows for each record: a row for the company name, a second row for   
  1087. the street address, a third row for the city, state and ZIP code, etc. In   
  1088. such a report all the data for a given customer in the list appears   
  1089. in a block. Each block represents a single record even though the data in   
  1090. the block spans several rows.   
  1091.   
  1092. 10.5.6  Data Types  
  1093.   
  1094. The data type of a field, (string, number, currency, date, Boolean, or memo)   
  1095. determines the type of information that can be stored in that field and   
  1096. which will print in the report column.   
  1097.   
  1098. Fields of each data type display on your screen like this:  
  1099.   
  1100. XXXXXXX         String - for example, a company name, account description   
  1101.         or customer name.  
  1102.   
  1103. $5,555,555.55   Currency (Paradox/Btrieve files only) - for example $500.00   
  1104.         or $50,000,000.00-.  
  1105.   
  1106. 5,555,555.55    Number - for example 120 or 5555.  
  1107.   
  1108. YYYY-MM-DD      Date - for example Oct 10 90.  
  1109.   
  1110. YES/NO          Boolean (YES/NO) data fields - for example, the result of a   
  1111.         formula which compares a customer's credit limit to see if   
  1112.         it is greater than $5000 and prints YES if the credit limit   
  1113.         is more than that amount; NO if it is less than that amount.  
  1114.   
  1115. XXXXXXX         Memo - a paragraph describing a piece of property,   
  1116.         comments regarding a job applicant, a summary of a movie   
  1117.         plot, etc.  
  1118.   
  1119. 10.5.7  Formatting, and Record and Group Selection  
  1120.   
  1121. While formatting, and record and group selection will be covered in depth   
  1122. later, there are a few things about those subjects that are worthwhile to   
  1123. cover here:  
  1124.   
  1125. o  Currency, date, and Boolean fields are shown above in the default format.   
  1126. This format is used for both the element markers (in the report editor) and   
  1127. for the report elements themselves (in the report). If you want your data   
  1128. to appear in a different format on your report, you can make the desired   
  1129. changes using the Format|Field command.  
  1130.   
  1131. NOTE:  The characters in the element markers change to reflect font changes   
  1132. and many formatting changes (alignment, etc.).  
  1133.   
  1134. o  The width and position of a field (when you place it in the Report Editor)   
  1135. determines the initial spacing between fields and the order in which the   
  1136. fields will print across the report page.  
  1137.   
  1138. o  When you insert a data field in your report, Crystal Reports assumes that   
  1139. you want to pull data from all the data records in the selected database.   
  1140. To limit the records (or groups of records) used in your report, you need   
  1141. to tell Crystal Reports how to identify the records or groups of records   
  1142. you want to include. Using Edit Record Selection Formula or Edit Group   
  1143. Selection Formula on the Print menu, you can build the selection formula   
  1144. that fits your needs.  
  1145.   
  1146.   
  1147. 10.6  Building Your Prototype  
  1148.   
  1149. To build your report you will follow these steps:  
  1150.   
  1151. o  Select the database(s) you wish to use in your prototype report.  
  1152. o  Enter and position the data fields, text, and titles you want included   
  1153. in the header, footer, and body of your report.  
  1154. o  Print your report to the Print Window and review your work.  
  1155. o  Make whatever changes are called for.  
  1156. o  Insert your totals, subtotals and other group fields.  
  1157. o  Enter and position any formula fields that will calculate or   
  1158. manipulate data or create flags.  
  1159. o  Print your report to the Print Window and review your work.  
  1160. o  Format the report elements that you want to stand out in some way from   
  1161. the others.   
  1162.   
  1163. 10.6.1 Selecting the Database(s)  
  1164.   
  1165. You use the File|New Report command to begin a report from scratch. That   
  1166. command leads you to a dialog box from which you can select the first   
  1167. database you wish to use. To select additional databases, you use the   
  1168. Database|Add File to Report command.  
  1169.   
  1170. 10.6.2 Entering and Positioning Data Fields  
  1171.   
  1172. Enter and position data fields using the Insert Database Field dialog   
  1173. box that lists available fields in the selected database. Make your   
  1174. selections from the list, and then place the field in your report using   
  1175. the rectangular field placement cursor that appears.  
  1176.   
  1177. 10.6.3  Adding Text  
  1178.   
  1179. You can add text to your report by typing it at the text cursor and then   
  1180. moving it into place. Move the I-beam cursor to the line on which you   
  1181. wish to enter text and click the left mouse button to set the text cursor   
  1182. at the left edge of the Report Editor. Then, simply type in your   
  1183. text, move the I-beam cursor in front of it, and push it into position using   
  1184. the Tab key or Space Bar. You can also add text by inserting text fields and   
  1185. positioning them as you would any other field.  
  1186.   
  1187. 10.6.4  Entering Field Titles  
  1188.   
  1189. By default, Crystal Reports automatically inserts a field title whenever   
  1190. you insert a new field or formula field. The title is a text field that can   
  1191. be edited. The left edge of the title field comes aligned with the left edge   
  1192. of the field it identifies. To toggle this feature off you use the   
  1193. File|Options command.  
  1194.   
  1195. 10.6.5  Printing and Reviewing  
  1196.   
  1197. You can print and review your work in progress at any time using the   
  1198. Print|Print To Window command. When you select this command, Crystal   
  1199. Reports prints your report to the print preview window.   
  1200.   
  1201. 10.6.6  Making Changes  
  1202.   
  1203. Move a database field drag it to a new position with the mouse, or by   
  1204. selecting it and using the Arrow keys. You can move a field within   
  1205. its originating section or to other sections of your report if you wish.   
  1206. To delete a field select it and then press the Delete key or select   
  1207. Edit|Clear.  
  1208.   
  1209. NOTE:  To select multiple fields at one time, press the Shift key and,   
  1210. while keeping it depressed, click the various fields you want to select.   
  1211. Handles will appear on each field selected. When finished, you can   
  1212. move or delete the selected fields as a group.  
  1213.   
  1214. 10.6.7  Placing Totals, Subtotals, and Other Group Values  
  1215.   
  1216. To place grand totals select the numeric or dollar field you want to total,   
  1217. and then select Insert|Grand Total from the Menu Bar.  
  1218.   
  1219. Select group values (subtotals, group averages, group counts, etc.) by   
  1220. first selecting the field you want grouped. Then select the kind of   
  1221. group value you want, using the Insert|Subtotal or Insert|Summary commands.   
  1222. Select the kind of group value you want (if you selected Insert|Summary).   
  1223. Then select the field that the program uses to sort and group your data   
  1224. by and the sort direction.  
  1225.   
  1226. 10.6.8  Moving Group Values  
  1227.   
  1228. To move a subtotal or summary drag it to a new position with the mouse, or   
  1229. select it and move it with the Arrow keys. You can move subtotals and   
  1230. summaries only within their originating sections, or from the group footer   
  1231. section to the group header section for the subtotal or summary of interest.  
  1232.   
  1233. 10.6.9  Entering Formulas  
  1234.   
  1235. Enter formulas using the Insert|Formula command. This command calls up   
  1236. the Formula Editor. Using the Formula Editor, build your formula using   
  1237. fields, functions, and operators, and check your work using the built in   
  1238. formula checker.  
  1239.   
  1240. 10.6.10  Formatting  
  1241.   
  1242. You can change the font or point size using the Format|Font command. You   
  1243. can change the alignment and printing characteristics of field data using   
  1244. the Format|Field command, and you can change the conditions that trigger   
  1245. subtotals, add page breaks, suppress blank lines, hide selected sections,   
  1246. etc. using the Format|Section command.   
  1247.   
  1248. Once you have built a prototype report, you have a working model that you   
  1249. can customize to meet your specific needs.  
  1250.   
  1251.   
  1252. 10.7  Manipulating the Data with Formulas and Functions  
  1253.   
  1254. Crystal Reports uses formulas and functions to help you create reports more   
  1255. quickly and easily. It uses them also to allow you to do the kind of   
  1256. "number crunching" and data manipulations that are necessary for advanced   
  1257. reporting.  
  1258.   
  1259. 10.7.1  Formulas  
  1260.   
  1261. A formula is a set of instructions that may be used to calculate   
  1262. information you can't obtain directly from database data fields.   
  1263.   
  1264. For example:  
  1265. o  A database record may have a Qty1 field and a Qty2 field but no field   
  1266. that sums both quantities. If you want the sum of these two fields to   
  1267. appear on your report, you need a formula that adds the value in one field   
  1268. to the value in the other.   
  1269.   
  1270. o  A database record for a sales rep may contain the field GrossSales and   
  1271. you want to use 120% of that gross as the sales quota for the following year.   
  1272. To accomplish this you need a formula that multiplies GrossSales by 120%.  
  1273.   
  1274. o  A database record for a one product company may contain a field Revenue   
  1275. that expresses total dollar sales for the year. You're interested in   
  1276. determining the number of units sold based on an average price of 49.95 per   
  1277. unit. To accomplish this you need a formula that divides Revenue by 49.95.  
  1278.   
  1279. All of these examples require simple formulas: {file.Qty1} + {file.Qty2},   
  1280. 1.20 * {file.GrossSales}, and {file.Revenue}/49.95 respectively. These   
  1281. formulas all use Crystal Reports operators (+, * [multiply], / [divide])   
  1282. and they're all easy to create and understand.  
  1283.   
  1284. But not all of your information needs can be reduced to simple formulas;   
  1285. some needs require extensive calculations or manipulations. For example:  
  1286.   
  1287. o  You want to determine your average monthly unit sales for the last year,   
  1288. rounded to the nearest unit.  
  1289.   
  1290. o  You want to convert ounces of inventory to pounds and ounces, and have   
  1291. it appear in the format x pounds y ounces.  
  1292.   
  1293. The formulas required to accomplish these activities require a fair amount   
  1294. of data manipulation: rounding, averaging, converting numbers to text,   
  1295. calculating remainders, etc. While some of the manipulations (averaging,   
  1296. calculating remainders) can be done using Crystal Reports operators alone,   
  1297. others can't be done without the use of functions. And even the ones that can   
  1298. be done without functions can be done more quickly and efficiently with them.   
  1299. (For additional information on formulas, see Crystal Reports Help.)  
  1300.   
  1301. 10.7.2  Functions  
  1302.   
  1303. A function is a preset procedure or subroutine used to evaluate, make   
  1304. calculations on, or transform data. For example:  
  1305.   
  1306. o  the NumericText function evaluates the contents of a text field to see   
  1307. if it is a number, and  
  1308.   
  1309. o  the UpperCase function transforms all lowercase characters in a string   
  1310. to uppercase.  
  1311.   
  1312. When you specify a function, Crystal Reports performs the set of operations   
  1313. built into the function without requiring you to specify each operation   
  1314. separately. For example:  
  1315.   
  1316. o  the Average function sums a list of values and divides the sum by the   
  1317. number of values in the list.  
  1318.   
  1319. o  the DayOfWeek function extracts the day component of a date, determines   
  1320. the day of the week the date falls on, and converts the day of the week to   
  1321. a number (1-7) where Sunday is the first day of the week.  
  1322.   
  1323. By performing multiple operations with a single command, these kinds of   
  1324. functions are a kind of shorthand that make it easier and less time   
  1325. consuming for you to create reports.   
  1326.   
  1327. But not all functions involve lengthy calculations; some simply allow you   
  1328. to do things that you couldn't do easily without them while others take the   
  1329. drudgery out of report creation. For example:  
  1330.   
  1331. o  the ToNumber function converts a number that has been stored as text,   
  1332. to a number that can be used in calculations, and  
  1333.   
  1334. o  TrimRight removes all the spaces to the right of a string of data   
  1335. stored left-justified in a database.  
  1336.   
  1337. 10.7.3  How Functions are Used  
  1338.   
  1339. Functions are used in formulas. In fact, a single function and its   
  1340. required argument(s) may include the entire formula. For example, Abs   
  1341. ({file.TestResult}) is a perfectly acceptable, stand-alone formula for   
  1342. calculating the absolute value of the field TestResult.  
  1343.   
  1344.      
  1345. 10.7.4  Function Syntax  
  1346.   
  1347. Each function comes with its own set of usage rules (syntax). These rules   
  1348. must be followed for the function to perform correctly. If they are not,   
  1349. Crystal Reports displays a Formula Compiler Error message.  
  1350.   
  1351. As an example, the correct syntax for using the Average([array]) function is:  
  1352.   
  1353.     Average ([array])  
  1354.   
  1355.     << where array is an array of constants, field values or calculation   
  1356.     results, separated by commas.>>  
  1357.   
  1358. Translated, this means that to use the Average([array]) function correctly,   
  1359. you should enter:   
  1360.   
  1361.     Average   
  1362.   
  1363. followed by a list of numeric values, separated by commas, with the list of   
  1364. values enclosed in brackets, and with the array enclosed in parentheses.   
  1365. Thus:  
  1366.   
  1367.     Average ([1,2,3,4,5])   
  1368.   
  1369. is an example of the correct way to use the Average([array]) function.  
  1370.   
  1371. If you try to use the function:  
  1372.   
  1373. o  without separating the values by commas,  
  1374. o  without enclosing the values in brackets,   
  1375. o  without enclosing the array in parentheses,   
  1376. o  while including any unnecessary characters, or   
  1377. o  with values that are not numeric,  
  1378.   
  1379. Crystal Reports won't accept the formula and will display a Compiler Error   
  1380. message identifying your error.  
  1381.   
  1382. 10.7.5  Entering Formulas and Functions  
  1383.   
  1384. Formulas and functions are entered via Crystal Reports' Formula Editor.  
  1385.   
  1386. The Formula Editor is a dialog box that contains all the tools you need to   
  1387. create and check the correctness of formulas. Using the Editor, you:  
  1388.   
  1389. o  assign a name to your formula,   
  1390. o  enter the formula,   
  1391. o  check it to make sure you have entered it correctly, and then   
  1392. o  accept it for use in your report.   
  1393.   
  1394. When you accept it, Crystal Reports places the formula in your report in the   
  1395. position you selected for it. Then, when you print the report, Crystal   
  1396. Reports prints the results of the formula instead of the formula itself.  
  1397.   
  1398. 10.7.6  The Fields Box  
  1399.   
  1400. You can enter fields into your formulas in two ways: via the Fields box, or   
  1401. manually.  
  1402.   
  1403. o  To enter a field via the Fields scroll box, you move the I-beam cursor   
  1404. to the place you want to insert the field and click the left mouse button to   
  1405. set the text cursor at that point. Then you locate the field you wish   
  1406. to insert from the Fields scroll box list.  
  1407.   
  1408.     - Fields already in use in the report are grouped at the top of the   
  1409.     list; other available fields follow.   
  1410.   
  1411.     - Formulas you have entered are listed next, their names preceded by   
  1412.     the @ sign.  
  1413.   
  1414.     - All other fields available in the active databases are listed   
  1415.     last, grouped by database.  
  1416.   
  1417. Select a field. Crystal Reports inserts the selected field (complete with   
  1418. the required syntax elements) at the text cursor.  
  1419.   
  1420. NOTE:  You select an item from the Formula Editor scroll boxes (Fields,   
  1421. Functions, or Operators) by double clicking it, or by clicking it once to   
  1422. highlight it and then clicking the Select button at the bottom of the   
  1423. Editor to complete the selection process.   
  1424.   
  1425. o  To enter a field manually, you locate the text cursor in the appropriate   
  1426. position and type in the field name as you would any text.   
  1427.   
  1428. o  The correct syntax for a database field name is:   
  1429.   
  1430.     {file.fieldname}  
  1431. If you:   
  1432.   
  1433.     - don't include the file name,  
  1434.     - leave out the separating period, or   
  1435.     - fail to surround the expression in braces,   
  1436.   
  1437. Crystal Reports will generate a Formula Compiler Error message detailing   
  1438. your error.  
  1439.   
  1440. o  The correct syntax for a formula field is:  
  1441.   
  1442.     {@formulaname}  
  1443.   
  1444. 10.7.7  Operators and Functions Boxes  
  1445.   
  1446. You can also enter operators and functions into your formula in one of two   
  1447. ways: manually or via the Operators and Functions scroll boxes.   
  1448.   
  1449. o  To enter an operator or function manually, locate the text cursor in   
  1450. the appropriate position and type in the operator or function as you would   
  1451. any text.   
  1452.   
  1453. o  To enter an operator or function via the lists in the Functions and   
  1454. Operators scroll boxes, set the text cursor where you want the entry   
  1455. to appear in the formula.   
  1456.     - Then select the item of interest from the scroll box lists.   
  1457.     Crystal Reports inserts the selected item in your formula, complete   
  1458.     with any parentheses, brackets, or commas required.  
  1459.   
  1460.     NOTE:  For an array of items, only the first comma is included. As   
  1461.     you enter additional items into an array, you will need to type in   
  1462.     commas to separate the items.  
  1463.   
  1464. 10.7.8  Order of Precedence  
  1465.   
  1466. When entering formulas that contain different kinds of operators, it is   
  1467. important to consider order of precedence, the order in which Crystal   
  1468. Reports performs the operations in your formula.   
  1469.   
  1470. You learned simple order of precedence in high school math: when performing   
  1471. calculations, do multiplication and division first, then addition and   
  1472. subtraction. Thus:  
  1473.   
  1474.     5 + 10 X 3 = 35  
  1475.   
  1476. The calculation 10 x 3 is performed first to get 30. 30 is then added to   
  1477. 5 to arrive at the final answer.  
  1478.   
  1479. Now if your intention is to add 5 to 10 and then multiply the sum by 3,   
  1480. you have to modify the order of precedence with parentheses. You can do   
  1481. that thus:  
  1482.   
  1483.     (5 + 10) x 3 = 45  
  1484.   
  1485. It's clear that parentheses have a higher precedence than the add,   
  1486. subtract, multiply, and divide operators. They redirect the order of   
  1487. calculation.  
  1488.   
  1489. You learned all of this in school and Crystal Reports follows the same   
  1490. rules of precedence. But Crystal Reports uses many additional operators,   
  1491. and it's important for you to understand the precedence Crystal Reports   
  1492. assigns to each so you can write your formulas to perform as expected.  
  1493.   
  1494. o  In the following list, Crystal Reports performs the top level operations   
  1495. first, then the second level, then the third, and so forth.  
  1496.   
  1497. o  When it encounters two or more operations that are on the same level,   
  1498. it performs them left to right.   
  1499.   
  1500. Level 1         Parentheses, Array, IfThenElse  
  1501. Level 2         Call, Subscript  
  1502. Level 3         Identity, Negate, Dollar, Not  
  1503. Level 4         Multiply, Divide, Percent  
  1504. Level 5         Add, Subtract  
  1505. Level 6         To  
  1506. Level 7         Less than, Greater than, Greater than or equal, Less than   
  1507.         or equal, In  
  1508. Level 8         Equal, Not equal  
  1509. Level 9         And  
  1510. Level 10        Or  
  1511.   
  1512. 10.7.9  Using Dates in Formulas  
  1513.   
  1514. Crystal Reports includes many useful functions for including dates and   
  1515. date ranges in formulas; you will learn more about those functions in   
  1516. Crystal Reports Help. At this point, however, it's useful to know how to   
  1517. enter any date into a formula.   
  1518.   
  1519. You enter a date simply by entering the Date function (manually or via the   
  1520. Function button) and then providing the date of interest in the parentheses   
  1521. that follow in the form YYYY,MM,DD (1992,01,01 = January 1, 1992).   
  1522.   
  1523. 10.7.10  The Formula Checker  
  1524.   
  1525. The Formula Editor also contains a formula checker which checks the syntax   
  1526. of your formula. If the syntax is incorrect, the formula checker points out   
  1527. the location of the problem and tells you what the problem is. You activate   
  1528. the formula checker by selecting the Check button. Crystal Reports also   
  1529. checks the formula automatically when you choose Accept. When debugging   
  1530. formulas, especially if you have entered them manually, look carefully for:  
  1531.   
  1532. o  missing quotation marks around text strings,   
  1533. o  missing database name accompanying field names,  
  1534. o  missing braces around database name/field name combinations,  
  1535. o  missing closing parentheses to match opening parentheses,   
  1536. o  case differences (the Formula Checker is case sensitive),  
  1537. o  if-then-else formulas that use different data types for the then and   
  1538. else actions, and  
  1539. o  using X instead of * for multiplication.  
  1540.   
  1541. The Formula Editor is easy to use and can be called up by selecting Formula   
  1542. from the Insert menu.  
  1543.   
  1544. 10.7.11  Developing Complex Calculations with Formulas  
  1545.   
  1546. Crystal Reports allows you to combine fields, functions, and operators to   
  1547. create complex calculations and manipulations of data. For example, to test   
  1548. the drawing power of two different offers, you can use a single Crystal   
  1549. Reports formula to send one offer to all customers with an even customer   
  1550. number and a second offer to all customers with an odd customer number. You   
  1551. can do some remarkable manipulations using Crystal Reports formulas.  
  1552.   
  1553.   
  1554. 10.8  Grouping, Summarizing, and Sorting Your Data  
  1555.   
  1556. Crystal Reports allows you to group, summarize, and sort your data to   
  1557. achieve the reporting results you want.  
  1558.   
  1559. 10.8.1  Grouping the Data  
  1560.   
  1561. A group is a set of records that are related to each other in some way.   
  1562. In a customer list, for example, a group could consist of all those   
  1563. customers living in the same ZIP code, or in the same state. In a sales   
  1564. report, a group could consist of all the orders placed by the same customer,   
  1565. or all of the orders generated by a specific sales rep.   
  1566.   
  1567. Breaking data into groups (and then doing something to evaluate the group   
  1568. data, if you wish) is a key part of effective reporting. In fact, it's what   
  1569. separates a report from being merely a presentation of raw data and a   
  1570. valuable communication tool.  
  1571.   
  1572. Crystal Reports allows you great flexibility in grouping data. It also   
  1573. gives you the ability to create a number of different kinds of group values.  
  1574.   
  1575. 10.8.2  Group Values  
  1576.   
  1577. A group value is the value generated as the result of an evaluation, a   
  1578. tally, or a calculation performed on data from a single group. A subtotal   
  1579. is one kind of group value; it is the sum of all of the values from a single   
  1580. field, from all the records in a group. In a sales report, for example, if   
  1581. you subtotal sales by sales rep, Crystal Reports gathers all the records   
  1582. that belong to the sales rep and totals the sales amounts from all the   
  1583. records. In a group average, Crystal Reports averages the values in a group   
  1584. of records; in a group count, it counts the values in a group of records,   
  1585. etc. Group values are important tools for creating powerful reports.   
  1586. Crystal Reports gives you several alternatives for working with group data.   
  1587. It enables you to:  
  1588.   
  1589. o  calculate the sum of values,   
  1590. o  calculate the standard deviation or variance of the values,  
  1591. o  average the values,   
  1592. o  count the values,   
  1593. o  determine the highest value, and  
  1594. o  determine the lowest value in the group.  
  1595.   
  1596. 10.8.3 Grouping Data with Crystal Reports  
  1597.   
  1598. While there may be many data fields on a report, there is typically only   
  1599. one field for which you are interested in grouping the data. In a sales   
  1600. report, for example, it would probably be the field listing the amount of   
  1601. sales; in a commission report, it would probably be the field listing the   
  1602. amount of commission, etc. To group data you first select the field you   
  1603. want to group together.  
  1604.   
  1605. Once the field is selected, you select the action you want to take on each   
  1606. group of data from that field:  
  1607.   
  1608. o  If you want to simply group the data and take no further action, you   
  1609. can select Insert|Group.  
  1610. o  If you want to subtotal it, you can select Insert|Subtotal.   
  1611. o  If you want to average, count, determine the maximum or minimum value,   
  1612. etc., you can select Insert|Summary.  
  1613.   
  1614. Subtotals and summaries make up the category of group fields.  
  1615.   
  1616. NOTE:  The Insert|Subtotal command is simply a shortcut for setting up   
  1617. a summary that adds the values in each group.  
  1618.   
  1619. Once you have selected the group field and the action, you select another   
  1620. field (a sort and group by field) that triggers a grouping whenever its   
  1621. value changes. In grouping your data by state, for example, you would use   
  1622. the state field to create a new group (and generate a group value if   
  1623. selected) whenever the state changes. Likewise, the ZIP code field would   
  1624. trigger a grouping whenever the ZIP code changes.  
  1625.   
  1626. Once you've made these simple selections, Crystal Reports does the rest.   
  1627. Your data will be grouped, and the group value (if you have selected one)   
  1628. will be calculated and will accompany each group.  
  1629.   
  1630.   
  1631. 10.9  Summarizing the Data  
  1632.   
  1633. Crystal Reports provides three easy-to-use summarizing options:  
  1634.   
  1635. Grand Total     A grand total adds all values in a field for the entire   
  1636.         report and prints the sum on the last page.  
  1637.           
  1638. Subtotal        A subtotal is a partial total, a total of a specific,   
  1639.         limited group of data in a field.  
  1640.   
  1641. Summary         A summary summarizes field data from a specific, limited   
  1642.         group of records. It can total the data like a subtotal,   
  1643.         but it can also average the values, count the values, or   
  1644.         determine the highest or lowest value in each group or field.  
  1645.   
  1646. All of these options are available on the Insert menu.  
  1647.   
  1648. 10.9.1  The Summarizing Process  
  1649.   
  1650. The process of summarizing the data on your report follows these steps:  
  1651.   
  1652. 1.  Selecting the field you want to summarize.  
  1653.   
  1654. 2.  Selecting the summarizing option you want from the Insert menu.  
  1655.   
  1656.     Finally, if you select Subtotal or Summary as a total type, the   
  1657.     process will also include the following step:  
  1658.   
  1659. 3.  Selecting the data field that triggers a new subtotal/summary   
  1660.     whenever its value changes.  
  1661.   
  1662. 10.9.2  Selecting a Field to Total  
  1663.   
  1664. To select the field you want to summarize, click on it with a mouse.   
  1665. Crystal Reports puts handles on the selected marker to highlight it as   
  1666. selected.  
  1667.   
  1668. 10.9.3  Selecting a Total Type  
  1669.   
  1670. To select a total type, select it from the Insert menu or pop-up menu.  
  1671.   
  1672. 10.9.4  Selecting a Field to Trigger a New Subtotal  
  1673.   
  1674. If you select Subtotal or Summary as a total type, Crystal Reports asks   
  1675. you to indicate the field that is to trigger a new subtotal/summary   
  1676. whenever its value changes.   
  1677.   
  1678. NOTE:  For additional information on subtotaling data (with examples),   
  1679. please see section 11.2.32 entitled "Sorting Your Data."  
  1680.   
  1681.   
  1682. 10.10  Sorting  
  1683.   
  1684. There is a logic to the way values are arranged when they appear in a   
  1685. column on your report. Initially, they are arranged in the same order as   
  1686. the data appears in your database. But data can be sorted in a variety of   
  1687. ways:  
  1688.   
  1689. o  A mailing list, for example, could be sorted in ascending order, on   
  1690. the ZIP code field; that is, the customers would be sorted so that those   
  1691. with the lowest ZIP codes would appear first and those with the highest   
  1692. ZIP codes would appear last.   
  1693.   
  1694. o  It could also be sorted in ascending alphabetical order, on the last   
  1695. name field; that is, customers with last names beginning with A would   
  1696. appear first and those with last names beginning with Z would appear last.   
  1697.   
  1698. o  It could also be sorted by street address or customer first name if   
  1699. you had some practical reason for doing so.   
  1700.   
  1701. Crystal Reports gives you the opportunity to change the existing sort order   
  1702. using the Print|Record Sort Order and Print|Group Sort Order commands.  
  1703.   
  1704. 10.10.1  Sorting by Record  
  1705.   
  1706. When you use the Print|Record Sort Order command, Crystal Reports asks you   
  1707. to select two things:  
  1708.   
  1709. o  the field you want your sort to be based on (sort field), and  
  1710. o  the sort direction.  
  1711.   
  1712. 10.10.2  Sort Field  
  1713.   
  1714. A sort field is a field that determines the order in which data appears on   
  1715. your report. Crystal Reports sorts field data using Windows' sort   
  1716. comparison algorithms, and it uses rules specific to the Country you   
  1717. select in the International section of the Windows Control Panel.  
  1718.   
  1719. You can use any field as a sort field. A field's data type determines the   
  1720. method in which the data from that field is sorted:   
  1721.   
  1722. Text            Text fields are sorted in the following manner:  
  1723.         One character values are sorted so that blanks have the   
  1724.         lowest value, then punctuation, then numbers, then   
  1725.         uppercase letters, and finally lowercase letters.   
  1726.         Then two character values are sorted, then three, etc.   
  1727.         using the same rules. As a result: "BOB" comes before "bob",   
  1728.         "123" comes before "124", " " (blank) comes before "a",   
  1729.         and "aa" comes before "aaa"   
  1730.   
  1731. Dollars         Dollar fields are sorted in numeric order.  
  1732.   
  1733. Number          Number values (120, or 5555) are sorted in numeric order.  
  1734.   
  1735. Dates           Date fields are sorted in chronological order.  
  1736.   
  1737. Booleans        Comparison fields are sorted so that false values come   
  1738.         first, then true.   
  1739.   
  1740. When you select a sort field, Crystal Reports sorts the values from   
  1741. that field.  
  1742.   
  1743. 10.10.3  Sort Direction  
  1744.   
  1745. Direction refers to the order in which the values are printed, once sorted.   
  1746.   
  1747. o  Ascending order means smallest to largest, 1 to 9, A to Z, False to True.  
  1748. o  Descending order means largest to smallest, 9 to 1, Z to A, True to False.  
  1749.   
  1750. 10.10.4  Single Field Sorts  
  1751.   
  1752. Single field sorts are sorts in which all the data in the report is sorted   
  1753. based on the values in a single field. Sorting an inventory report by stock   
  1754. number and sorting a customer list by customer number are examples of single   
  1755. field sorts.   
  1756.   
  1757. 10.10.5  Multiple Field Sorts  
  1758.   
  1759. In multiple field sorts, Crystal Reports first sorts the entries   
  1760. (alphabetic or numeric) in the first field selected, putting them in   
  1761. ascending or descending order as specified. Then it sorts any entries in   
  1762. the second field that can be sorted without disturbing the sort order of   
  1763. entries in the first field. It then sorts any entries in the third field   
  1764. that can be sorted without disturbing the sort order of the entries in the   
  1765. first two fields. It follows the same pattern for sorting additional fields.  
  1766.   
  1767. 10.10.6  Sorting Groups  
  1768.   
  1769. Crystal Reports allows you to change the order in which groups appear on   
  1770. your report. You can:  
  1771.   
  1772. o  base the sort on any group (subtotal or summary) in your report, and  
  1773. o  sort your report so that group field values appear in ascending or   
  1774. descending order.  
  1775.   
  1776. You change the sort order using the Print|Group Sort Order command. When   
  1777. you sort by group, nothing happens to the sort order of the records within a   
  1778. group; only the relative positions of the groups themselves change.  
  1779.   
  1780. NOTE:  For additional information on sorting and examples of single field,   
  1781. multiple field, and group sorts, please see section 11.2.32 entitled   
  1782. "Sorting YourData."  
  1783.   
  1784.   
  1785. 10.11  Editing and Formatting the Data  
  1786.   
  1787. Crystal Reports makes it easy to edit and format your data. The   
  1788. editing/formatting process follows these steps:  
  1789.   
  1790. 1.  Selecting the data you want to edit or format.  
  1791.   
  1792. 2.  Selecting the editing or formatting action you want to take place.   
  1793.   
  1794. 3.  Entering the specifics of the action in the dialog box/editor   
  1795.     if/when it appears.  
  1796.   
  1797. 10.11.1  Selecting the Data  
  1798.   
  1799. To select the data element you want to edit or format, you click on it   
  1800. with your mouse. Crystal Reports draws handles on the element marker to   
  1801. highlight it as selected.  
  1802.   
  1803. 10.11.2  Selecting the Action  
  1804.   
  1805. Once the element is selected, you select the editing or formatting action   
  1806. from Crystal Reports' Edit or Format menus. For example:  
  1807.   
  1808. o  to change the font used to print the data, select Font from the Format   
  1809. menu,  
  1810. o  to hide the field when printing, select Field from the Format menu, or  
  1811. o  to modify a formula, select Formula from the Edit menu.  
  1812.   
  1813. 10.11.3  Entering the Specifics  
  1814.   
  1815. In those cases where a dialog box or editor appears after you've selected   
  1816. an action, you enter the specifics of that action in the window that appears.   
  1817. For example:  
  1818.   
  1819. o  in the Font dialog box, you enter the font and point size you wish to   
  1820. use, and indicate whether you want the data to appear in boldface or italics,   
  1821. or whether you want it to be underlined or overprinted with the strikeout   
  1822. character, and  
  1823.   
  1824. o  in the Formula Editor, you make the changes you want to the formula that   
  1825. appears, check those changes if you wish, and accept the revised formula   
  1826. when you're finished.   
  1827.   
  1828. Crystal Reports takes it from there and performs the action you selected.  
  1829.   
  1830. NOTE:  In some cases you have to specify a second action to complete the   
  1831. editing change desired. For example, to move some text in your report, you   
  1832. first cut the text from its current position, and then you paste it in its   
  1833. new position. In such a case you select the data and then the action (Cut)   
  1834. to cut the text to the clipboard. Then you mark the new position using the   
  1835. insertion pointer and select Paste to insert the text in the new position.  
  1836.   
  1837.   
  1838. 10.12  Specifying Records/Groups to be Included  
  1839.   
  1840. When you select a field to appear on your report, Crystal Reports, by   
  1841. default, prints field values from every record in the selected database.   
  1842. But in many cases you may not want to include all the values, but only a   
  1843. specific range of values. For example, you may want to include only a   
  1844. specific group of customers or a specific range of account numbers out of   
  1845. the total number of values in the database. Or you may want to include   
  1846. values from only those records that fall within a particular date range.   
  1847. With Crystal Reports this is easy. The program includes four commands on the   
  1848. Print menu for restricting your report to specific records or groups of   
  1849. records as described in the following sections:  
  1850.   
  1851. 10.12.1  Select Records  
  1852.   
  1853. This option allows you to limit your report to specific records that fit a   
  1854. condition or conditions you specify. It automatically builds a record   
  1855. selection formula using your responses to dialog box questions. This option   
  1856. requires no knowledge of the Crystal Reports formula language.  
  1857.   
  1858. 10.12.2  Edit Record Selection Formula  
  1859.   
  1860. This option also allows you to limit your report to specific records that   
  1861. fit a condition or conditions you specify. It takes you to the Formula   
  1862. Editor where you can manually build a record selection formula to fit   
  1863. your needs. This command is intended for users who are familiar with the   
  1864. Crystal Reports formula language.  
  1865.   
  1866. 10.12.3  Select Groups  
  1867.   
  1868. This option allows you to limit your report to specific groups that fit a   
  1869. condition or conditions you specify. It automatically builds a group   
  1870. selection formula using your responses to dialog box questions. This   
  1871. option requires no knowledge of the Crystal Reports formula language.  
  1872.   
  1873. 10.12.4  Edit Group Selection Formula  
  1874.   
  1875. This option also allows you to limit your report to specific groups of   
  1876. records that fit a condition or conditions you specify. It takes you to   
  1877. the Formula Editor where you can manually build a group selection formula   
  1878. to fit your needs. This command is intended for users who are familiar with   
  1879. the Crystal Reports formula language.  
  1880.   
  1881. You select the command, specify the records or groups of records you want   
  1882. included, and your report prints using only the selected records or groups.  
  1883.   
  1884.   
  1885. 10.13  Printing the Finished Report  
  1886.   
  1887. When you want to print your report or when you want to see what your report   
  1888. will look like when printed, use Crystal Reports' three printing options:  
  1889.   
  1890. o  printing to the printer for hard copy output  
  1891. o  printing to a print window to review your work  
  1892. o  printing to a disk file for use with other applications  
  1893.   
  1894. All of these options are available on the Print menu.  
  1895.   
  1896. When you are creating a report, you will find yourself printing to the   
  1897. print window often, in order to check placement and formatting of the   
  1898. various report elements. The print window even includes a print preview   
  1899. function that lets you see each page of your report as a whole, top to   
  1900. bottom. Then, when you want to print a final or interim copy of the report   
  1901. for hands-on review, you can print to the printer for hard copy output.   
  1902.   
  1903. If you want to use your report data in another application (in a spreadsheet   
  1904. or word processor for example), you can print the report to a disk file in   
  1905. any of a variety of popular file formats. Once in a disk file, you can import   
  1906. the data into your other application following the importing procedures   
  1907. established by the receiving application.  
  1908.   
  1909.  
  1910.